home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / dev / lang / amigatalk.lha / intuition / SetupIntuition.st < prev    next >
Text File  |  2002-03-24  |  4KB  |  134 lines

  1. " ------------------------------------------------------------------- "
  2. " Intuition Class is a Singleton class that allows the user to        "
  3. " reference intuition-specific singleton classes in one spot.         "
  4. ""
  5. " ALL singleton classes MUST contain the following:                   "
  6. ""
  7. "   the methods:  isSingleton AND privateSetup     AND                "
  8. "                 uniqueInstance Class instance variable.             "
  9. " ------------------------------------------------------------------- "
  10.  
  11. Class Intuition :Dictionary 
  12. ! uniqueInstance gadgetAttrs     gadgetFlags gadgetTypes gadToolsAttrs
  13.   gadgetActs     gadgetMethodIDs idcmpFlags  screenTags  windowFlags 
  14.   windowTags     specialTags     icClass     methodIDs   imageTags
  15.   menuFlags      reqFlags        boopsiNames iconTags    iconTypeTags
  16.   workbenchTags  workbenchFlags  appMsgTags
  17. !
  18. [
  19.    isSingleton
  20.      ^ true  
  21. |  
  22.    privateNew ! newInstance !
  23.      newInstance <- super new.
  24.      ^ newInstance
  25. |
  26.    new
  27.      ^ (self privateSetup)
  28. |
  29.    privateSetup
  30.      (uniqueInstance isNil)
  31.        ifTrue: [uniqueInstance  <- self privateNew.
  32.  
  33.                 iconTags        <- IconTags         new.
  34.                 iconTypeTags    <- IconTypeTags     new.
  35.  
  36.                 workbenchTags   <- WorkbenchTags    new.  
  37.                 workbenchFlags  <- WorkbenchFlags   new.
  38.                 appMsgTags      <- AppMsgTags       new.
  39.                 
  40.                 specialTags     <- SpecialTags new.
  41.  
  42.                 "BOOPSI tag Singleton classes:"
  43.                 icClass         <- ICClass          new.
  44.                 methodIDs       <- MethodIDs        new.
  45.                 imageTags       <- ImageTags        new.
  46.                 boopsiNames     <- BoopsiClassNames new.
  47.  
  48.                 "Initialize all Intuition Singleton classes:"
  49.                 gadToolsAttrs   <- GadToolsAttributes new.
  50.  
  51.                 gadgetAttrs     <- GadgetAttributes new.
  52.                 gadgetMethodIDs <- GadgetMethodIDs  new.
  53.                 gadgetFlags     <- GadgetFlags      new.
  54.                 gadgetTypes     <- GadgetTypes      new.
  55.                 gadgetActs      <- GadgetActivation new.
  56.  
  57.                 screenTags      <- ScreenTags       new.
  58.                 windowTags      <- WindowTags       new.
  59.                 windowFlags     <- WindowFlags      new.
  60.                 idcmpFlags      <- IDCMPFlags       new.
  61.                 menuFlags       <- MenuFlags        new.
  62.                 reqFlags        <- RequesterFlags   new.
  63.                ].
  64.  
  65.      ^ self "uniqueInstance??"
  66. |
  67.    getBoopsiClassName: key
  68.      ^ boopsiNames at: key
  69. |
  70.    getRequesterFlag: key
  71.      ^ reqFlags at: key
  72. |
  73.    getWorkbenchTag: key
  74.      ^ workbenchTags at: key
  75. |
  76.    getWorkbenchFlag: key
  77.      ^ workbenchFlags at: key
  78. |
  79.    getAppMsgTag: key
  80.      ^ appMsgTags at: key
  81. |
  82.    getMenuFlag: key
  83.      ^ menuFlags at: key
  84. |
  85.    getIconTag: key
  86.      ^ iconTags at: key
  87. |
  88.    getIconTypeTag: key
  89.      ^ iconTypeTags at: key
  90. |
  91.    getSpecialTag: key
  92.      ^ specialTags at: key
  93. |
  94.    getImageTag: key
  95.      ^ imageTags at: key
  96. |
  97.    getICClass: key
  98.      ^ icClass at: key
  99. |
  100.    getMethodID: key
  101.      ^ methodIDs at: key
  102. |
  103.    getGadgetAttr:  key
  104.      ^ gadgetAttrs at: key
  105. |
  106.    getGadToolAttr: key
  107.      ^ gadToolsAttrs at: key
  108. |
  109.    getGadgetFlag:  key
  110.      ^ gadgetFlags at: key
  111. |
  112.    getGadgetType:  key
  113.      ^ gadgetTypes at: key
  114. |
  115.    getGadgetMethodID:  key
  116.      ^ gadgetMethodIDs at: key
  117. |
  118.    getGadgetActivation:  key
  119.      ^ gadgetActs at: key
  120. |
  121.    getScreenTag:   key
  122.      ^ screenTags at: key
  123. |
  124.    getWindowTag:   key
  125.      ^ windowTags at: key
  126. |
  127.    getIDCMPFlag:   key
  128.      ^ idcmpFlags at: key
  129. |
  130.    getWindowFlag:  key
  131.      ^ windowFlags at: key
  132. ]
  133.  
  134.